var listviewName = "费用明细"
var cellNameArr = ["CostAmountSummary"]

var page = Forguncy.Page;
var listview = page.getListView(listviewName);

function setTotalRowValues(cellNameArr, listviewName) {
	const cellValues = new Array(cellNameArr.length).fill(0)
	for(let i=0; i<cellNameArr.length; i++) {
		if(cellNameArr[i] !== null) {
			cellValues[i] = Forguncy.Page.getCell(cellNameArr[i]).getValue()
		}
	}
	var listview = Forguncy.Page.getListView(listviewName)._grid;
	Forguncy.ListViewHelper.RequestHelper.assignTotalRowValues(listview, cellValues);
}

function setValueChange() {
	// arg1: 列汇总行数组
	// arg2: 设置汇总行的表格名
	setTotalRowValues(cellNameArr, listviewName)
}

listview.bind("valueChanged", setValueChange);